NAND-type flash memory is an example of a nonvolatile memory. In the NAND-type flash memory, as a program voltage or an erase voltage is repeatedly applied to memory cells, a tunnel oxide film of the memory cell may deteriorate, and an error may occur in programming, reading, or erasing for the memory cell.